FROM 172.16.0.5:5000/openjdk:latest

ARG SRV_RUN_NAME=common_service
ENV JAR_NAME=${SRV_RUN_NAME}
ADD ${JAR_NAME}.jar /apps/${JAR_NAME}.jar
WORKDIR /apps
ENV JAVA_OPTS="-Djava.security.egd=file:/dev/./urandom"

ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

CMD exec java ${JAVA_OPTS} -jar -XX:MaxMetaspaceSize=128m -Xms800m -Xmx800m -Xmn256m -Xss256k -XX:SurvivorRatio=8 -XX:+UseConcMarkSweepGC /apps/${JAR_NAME}.jar